package com.zw.a.basic.a07.demo11_coach;

//案例: 运动员和教练类案例,   该类是一个测试类
public class PersonTest {
    public static void main(String[] args) {
        //1. 测试乒乓球运动员.
        //接口多态
        //SpeakEnglish se = new PingPangPlayer("马龙", 31);

        //抽象类多态
        //Person p = new PingPangPlayer("马龙", 31);
        //Player p2 = new PingPangPlayer("马龙", 31);

        //标准写法
        PingPangPlayer p1 = new PingPangPlayer("马龙", 31);
        //打印属性值.
        System.out.println(p1.getName() + "..." + p1.getAge());
        //调用方法
        p1.eat();
        p1.study();
        p1.speak();
        System.out.println("----------------------------");

        //2. 测试乒乓球教练.
        PingPangCoach p2 = new PingPangCoach("刘国梁", 45);
        //打印属性值.
        System.out.println(p2.getName() + "..." + p2.getAge());
        //调用方法
        p2.eat();
        p2.teach();
        p2.speak();

        //3. 测试篮球运动员.

        //4. 测试篮球教练.
    }
}
